/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.scene.service.api;

import com.koron.common.bean.StaffBean;
import com.koron.common.domain.DataBean;
import com.koron.hiddendanger.domain.HiddenDangerDiscovery;
import com.koron.scene.bean.CalibrationHistoryView;
import com.koron.scene.bean.CheckResultView;
import com.koron.scene.domain.Device;
import org.springframework.web.multipart.MultipartFile;
import org.swan.bean.MessageBean;

import java.sql.Timestamp;
import java.util.List;

public interface DeviceService {

    /**
     * fetch all devices in the given condition
     *
     * @param gridCode
     * @param deviceName
     * @param checkEmployeeName
     * @param calibrationExpiredDate
     * @param start
     * @param rows
     * @return
     */
    DataBean<Device> fetchDevices(String corpCode, String gridCode, String deviceName, String deviceTypeId, String deptName, String checkEmployeeName, Timestamp calibrationExpiredDate, Integer status, Integer start, Integer rows,String keyword);


    /**
     * query the one whose id is the given
     *
     * @param id
     * @return
     */
    Device fetchOne(String id);


    /**
     * delete devices in batch
     *
     * @param idList
     * @return
     */
    Boolean batchDetele(List<String> idList);

    /**
     * write device
     *
     * @return
     */
    Integer persist(Device device);


    /**
     * check history on the device
     *
     * @param deviceName
     * @param deviceId
     * @param start
     * @param rows
     * @return
     */
    DataBean<CheckResultView> checkHistory(String deviceName, String deviceId, Integer start, Integer rows);


    /**
     * calibration history on the device
     *
     * @param deviceName
     * @param deviceId
     * @param start
     * @param rows
     * @return
     */
    DataBean<CalibrationHistoryView> calibrationHistory(String deviceName, String deviceId, Integer start, Integer rows);


    List<HiddenDangerDiscovery> getHiddenDangers(List<String> idList);

    MessageBean<?> importExcel(StaffBean user, MultipartFile file);
}
